@extends('admin._layout.master')

@section('content')
    <section class="Hui-article-box">
        <nav class="breadcrumb">
            <i class="Hui-iconfont">&#xe67f;</i> 首页
            <span class="c-gray en">&gt;</span> 管理员管理
            <span class="c-gray en">&gt;</span> 新增管理员
            <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
                <i class="Hui-iconfont">&#xe68f;</i>
            </a>
        </nav>
        <div class="pd-20">
            <form id="addForm" class="form form-horizontal" method="post" action="" onsubmit="return false;">
                {{ csrf_field() }}
                <div class="row cl">
                    <label class="form-label col-xs-2"><span class="c-red">*</span>管理员名：</label>
                    <div class="formControls col-xs-4">
                        <input type="text" class="input-text" name="name" value=""
                        datatype="s2-20" nullmsg="请输入管理员名！" errormsg="管理员名为2-20个字符！">
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-2"><span class="c-red">*</span>管理员密码：</label>
                    <div class="formControls col-xs-4">
                        <input type="password" class="input-text" name="pwd" value=""
                        datatype="*6-20" nullmsg="请输入管理员密码！" errormsg="密码为6-20位字符！">
                    </div>
                </div>
                <div class="row cl">
                    <div class="col-xs-8 col-xs-offset-2">
                        <button id="submit" class="btn btn-primary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存并提交</button>
                    </div>
                </div>
            </form>
        </div>
    </section>
@endsection

@section('javascript')
    <script type="text/javascript">
        $(function () {
            $('#addForm').Validform({
                btnSubmit: '#submit',
                tiptype: function (msg) {
                    layer.alert(msg, {title: '提示信息'});
                },
                tipSweep: true,
                ajaxPost: true,
                callback: function (data) {
                    if (data.status == 'y') {
                        location.href = "{{ url('admin/member') }}";
                    }
                }
            });
        });
    </script>
@endsection